<?php /* 程序侠版权所有 技术论坛支持: bbs.chengxuxia.com QQ: 573907419 正版授权防止出现漏洞后门
-- enphp : https://git.oschina.net/mz/mzphp2
 */

namespace app\common\taglib;
error_reporting(E_ALL ^ E_NOTICE);
error_reporting(E_ALL ^ E_NOTICE);
use think\template\TagLib;

class Base extends Taglib
{
    protected $tags = ['nav' => ['attr' => 'field,name,sort', 'close' => 1], 'banner' => ['attr' => 'field,position,name,sort', 'close' => 1], 'link' => ['attr' => 'field,name,sort', 'close' => 1],];

    public function tagNav($var_1, $var_2)
    {
        $var_4 = empty($var_1['where ']) ? 'true' : $var_1['where'];
        $var_5 = empty($var_1['field']) ? 'true' : $var_1['field'];
        $var_6 = empty($var_1[sort]) ? 'sort asc' : $var_1[sort];
        $var_7 = $var_7 = '<?php ';
        $var_7 .= '$__NAV__ = \\think\\Db::name(\'Nav\')->field(' . $var_5 . ')->where("status","1")->where(' . $var_4 . ')->order("' . $var_6 . '")->select();';
        $var_7 .= '?>{volist name="__NAV__" id="' . $var_1['name'] . '"}';
        $var_7 .= $var_2;
        $var_7 .= '{/volist}';
        $this->tpl->parse($var_7);
        return $var_7;
    }

    public function tagBanner($var_8, $var_9)
    {
        $var_11 = empty($var_8['field']) ? 'true' : $var_8['field'];
        $var_12 = empty($var_8['position']) ? !0 : '\'position\',' . $var_8['position'];
        $var_13 = empty($var_8[sort]) ? 'sort ASC' : $var_8[sort];
        $var_14 = $var_14 = '<?php ';
        $var_14 .= '$__BANNER__ = \\think\\Db::name("Ad")->field(' . $var_11 . ')->where(' . $var_12 . ')->where("end_time","gt",' . time() . ')->where("status","1")->order("' . $var_13 . '")->select();';
        $var_14 .= '?>';
        $var_14 .= '{volist name="__BANNER__" id="' . $var_8['name'] . '"}';
        $var_14 .= $var_9;
        $var_14 .= '{/volist}';
        $this->tpl->parse($var_14);
        return $var_14;
    }

    public function tagLink($var_15, $var_16)
    {
        $var_18 = empty($var_15['field']) ? 'true' : $var_15['field'];
        $var_19 = empty($var_15[sort]) ? 'sort asc' : $var_15[sort];
        $var_20 = $var_20 = '<?php ';
        $var_20 .= '$__LINK__ = \\think\\Db::name("Link")->field(' . $var_18 . ')->where("status","1")->order("' . $var_19 . '")->select();';
        $var_20 .= '?>{volist name="__LINK__" id="' . $var_15['name'] . '"}';
        $var_20 .= $var_16;
        $var_20 .= '{/volist}';
        $this->tpl->parse($var_20);
        return $var_20;
    }
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;